package state.program.context;

import state.program.states.*;
import state.program.states.base.State;

public class Context {

    State initState = new InitState(this);
    State startState = new StartState(this);
    State runState = new RunState(this);
    State endState = new EndState(this);

    State noState = new NoState(this);

    State state;

    public Context() {
        state = noState;
    }

    /* 做目前状态应该做的事 */
    public void act() {
        state.doAction();
    }

    public void setState(State state) {
        this.state = state;
    }

    public State getInitState() {
        return initState;
    }

    public State getStartState() {
        return startState;
    }

    public State getRunState() {
        return runState;
    }

    public State getEndState() {
        return endState;
    }

    public State getNoState() {
        return noState;
    }

    public State getState() {
        return state;
    }
}
